/*
 * @Author: Song Xinxin
 * @Date: 2022-10-31 09:20:03
 * @LastEditors: Song Xinxin
 * @LastEditTime: 2022-10-31 12:20:53
 * @FilePath: \WYW_0419_Oasis\JavaScripts\UI\UIDeath.ts
 * @Description: 
 * 
 * Copyright (c) 2022 by error: git config user.name && git config user.email & please set dead value or install git, All Rights Reserved. 
 */
import { Consts } from "../Consts";
import { UI_DeathUI } from "./UITemplate"

//死亡UI
export class UIDeath extends UI_DeathUI
{

    protected onShow():void
    {

        //重置复活倒计时
        let count:number = Consts.RES_TIME;
        this.text_ResTime.setText(count.toString());
        
        //倒计时每隔1秒变一次
        let interval = setInterval(()=>
        {
            count--;
            this.text_ResTime.setText(count.toString());
            if(count <= 0)
            {
                clearInterval(interval);
            }
        },1000)
    }
}